package com.leemz.design.chapter7.pattern;

import com.leemz.design.chapter7.none.CpuApi;
import com.leemz.design.chapter7.none.MainBoardApi;

public class ComputerEngineerPattern {
    private CpuApi cpuApi = null;
    private MainBoardApi mainBoardApi = null;

    public void makeComputer(AbstractFactory schema) {
        preparedHardwares(schema);
    }

    private void preparedHardwares(AbstractFactory schema) {
        cpuApi = schema.createCpuApi();
        mainBoardApi = schema.createMainBoardApi();
        cpuApi.calculate();
        mainBoardApi.installCpu();
    }
}
